Number

abstract class Number

Superclass for all platform classes representing numeric values.

Constructors

Number
Link copied to clipboard
fun Number()

Functions

toByte
Link copied to clipboard
abstract fun toByte(): Byte

Returns the value of this number as a Byte, which may involve rounding or truncation.

toChar
Link copied to clipboard
abstract fun toChar(): Char

Returns the Char with the numeric value equal to this number, truncated to 16 bits if appropriate.

toDouble
Link copied to clipboard
abstract fun toDouble(): Double

Returns the value of this number as a Double, which may involve rounding.

toFloat
Link copied to clipboard
abstract fun toFloat(): Float

Returns the value of this number as a Float, which may involve rounding.

toInt
Link copied to clipboard
abstract fun toInt(): Int

Returns the value of this number as an Int, which may involve rounding or truncation.

toLong
Link copied to clipboard
abstract fun toLong(): Long

Returns the value of this number as a Long, which may involve rounding or truncation.

toShort
Link copied to clipboard
abstract fun toShort(): Short

Returns the value of this number as a Short, which may involve rounding or truncation.

Inheritors

Byte
Link copied to clipboard
Short
Link copied to clipboard
Int
Link copied to clipboard
Long
Link copied to clipboard
Float
Link copied to clipboard
Double
Link copied to clipboard

Extensions

narrow
Link copied to clipboard
inline external fun <R : Number> Number.narrow(): R
signExtend
Link copied to clipboard
inline external fun <R : Number> Number.signExtend(): R